<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* .container {
      display: flex;
      flex-wrap: wrap;
      width: 500px;
      background-color: red;
      justify-content: space-between;
    }
    .item {
      border: 1px solid #333;
      height: 100px;
      width: 25%;
      background-color: #fff;
    } */

    .container {
      display: grid;
      /* 不知道一列占据多数，自动填充：auto-fill */
      grid-template-columns: repeat(auto-fill, 100px);
      background-color: red;
      justify-content: space-between;
      gap: 30px;
    }
    .item {
      border: 1px solid #333;
      height: 100px;
      background-color: #fff;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
    <div class="item">10</div>
    <div class="item">11</div>
    <div class="item">12</div>
    <div class="item">13</div>
    <div class="item">14</div>
  </div>
</body>
</html>